package com.ryskoo.common.dto.product;

import com.ryskoo.common.constant.ProductConstant;
import com.ryskoo.common.dto.BasicDTO;
import com.ryskoo.common.dto.stock.StockDTO;

import java.util.List;
/**
 * 商品DTO
 * 
 * @author qyc
 *
 */
public class ProductDTO extends BasicDTO{

	private static final long serialVersionUID = 6256443362805642068L;

	/* 商品名称 */
	private String productName;

	/* 推荐语 */
	private String recommendation;
	
	/* 是否逻辑删除  */
	private boolean delFlag = false;

	/* 关键字 */
	private String keyWord;

	/* 所属分类 */
	private String categoryId;

	/* 所属品牌 */
	private String brandId;

	/* 所属商户 */
	private String vendorUuid;
	
	/* 所属仓库 */
	private String warehouseUuid;

	/* 商品类型 普通商品1、 */
	private String type = "1";
	
	/* 商品排序 */
	private int position;

	/* 上架状态 */
	private boolean putonState = false;

	/* seo搜索的title */
	private String pageTitle;
	
	/* seo搜索的key */
	private String pageKey;
	
	/* seo搜索的描述 */
	private String pageDesc;
	
	/* 小单位 例如 瓶、千克等, 保存的单位uuid */
	private String smallUnit;

	/* 大单位 例如 箱、吨等, 保存的单位uuid */
	private String bigUnit;

	/* 大小单位换算关系 1大单位=?小单位 */
	private int changeNum;

	/* 小单位规格条形码 */
	private String smallBarcode;

	/* 大单位规格条形码 */
	private String bigBarcode;

	/* 小单位重量 */
	private double smallWeight = 0;
	
	/* 起批量 */
	private int tradeNum ;
	
	/* 起批量单位：0：小单位   1：大单位 */
	private String tradeNumUnit ;

	/* 是否有多规格 */
	private boolean specState = false;
	
	/* 多规格的json格式，用于商品详情页解析展示选择 */
	private String attrJson ;
	
	/* 规格参数的json格式，用于商品详情的描述解析展示 */
	private String attrParamJson ;
	
	/* 商品标签 */
	private String productTag;
	
	/* 审核人*/
	private String auditor;
	
	/* 审核状态*/
	private String auditState;
	
	/* 审核时间*/
	private String auditTime;
	
	/* 审核说明*/
	private String auditNote;
	
	/* 是否编辑完成 */
	private int finish;
	
	/* 商品标签页面展示*/
	private String productTagName;
	
	/* 品牌名称页面展示*/
	private String brandName;
	
	/* 商户名称页面展示*/
	private String vendorName;
	
	/* 分类名称页面展示*/
	private String categoryName;
	
	/* 是否多规格页面展示*/
	private String specStateName;
	
	/* 上下架页面展示*/
	private String putonStateName;
	
	/* 审核状态页面展示*/
	private String auditStateName;
	
	/* 商品默认规格价格对象 */
	private ProductPriceDTO productPrice;
	
	/* 商品默认规格价格对象List */
	private List<ProductPriceDTO> productPriceList;
	
	/* 商品默认规格属性对象 */
	private StockDTO productStock;
	
	/* 商品默认规格属性对象List */
	private List<StockDTO> productStockList;
	
	/* 商品默认图片对象 */
	private ProductImageDTO productImage;
	
	/* 商品默认图片对象List */
	private List<ProductImageDTO> productImageList;
	
	/* 商品默认描述对象 */
	private ProductDescDTO productDesc;
	
	
	
	
	public String getSpecStateName() {
		if(this.specState){
			return "多规格";
		}
		return "单规格";
	}

	public void setSpecStateName(String specStateName) {
		this.specStateName = specStateName;
	}

	public int getPosition() {
		return position;
	}

	public void setPosition(int position) {
		this.position = position;
	}

	public ProductImageDTO getProductImage() {
		return productImage;
	}

	public void setProductImage(ProductImageDTO productImage) {
		this.productImage = productImage;
	}

	public String getPutonStateName() {
		if(this.putonState){
			return "上架";
		}else{
			return "下架";
		}
	}

	public void setPutonStateName(String putonStateName) {
		this.putonStateName = putonStateName;
	}

	public String getAuditStateName() {
		if("1".equals(this.auditState)){
			return "审核通过";
		}else if("2".equals(this.auditState)){
			return "审核不通过";
		}else{
			return "未审核";
		}
	}

	public void setAuditStateName(String auditStateName) {
		this.auditStateName = auditStateName;
	}

	public String getAttrParamJson() {
		return attrParamJson;
	}

	public void setAttrParamJson(String attrParamJson) {
		this.attrParamJson = attrParamJson;
	}

	public ProductPriceDTO getProductPrice() {
		return productPrice;
	}

	public boolean isDelFlag() {
		return delFlag;
	}

	public void setDelFlag(boolean delFlag) {
		this.delFlag = delFlag;
	}

	public void setProductPrice(ProductPriceDTO productPrice) {
		this.productPrice = productPrice;
	}

	public StockDTO getProductStock() {
		return productStock;
	}

	public void setProductStock(StockDTO productStock) {
		this.productStock = productStock;
	}

	public String getAttrJson() {
		return attrJson;
	}

	public void setAttrJson(String attrJson) {
		this.attrJson = attrJson;
	}

	public String getPageTitle() {
		return pageTitle;
	}

	public void setPageTitle(String pageTitle) {
		this.pageTitle = pageTitle;
	}

	public String getPageKey() {
		return pageKey;
	}

	public void setPageKey(String pageKey) {
		this.pageKey = pageKey;
	}

	public String getPageDesc() {
		return pageDesc;
	}

	public void setPageDesc(String pageDesc) {
		this.pageDesc = pageDesc;
	}

	public int getFinish() {
		return finish;
	}

	public void setFinish(int finish) {
		this.finish = finish;
	}

	public List<ProductPriceDTO> getProductPriceList() {
		return productPriceList;
	}

	public void setProductPriceList(List<ProductPriceDTO> productPriceList) {
		this.productPriceList = productPriceList;
	}

	public List<StockDTO> getProductStockList() {
		return productStockList;
	}

	public void setProductStockList(List<StockDTO> productStockList) {
		this.productStockList = productStockList;
	}

	public List<ProductImageDTO> getProductImageList() {
		return productImageList;
	}

	public void setProductImageList(List<ProductImageDTO> productImageList) {
		this.productImageList = productImageList;
	}


	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public String getRecommendation() {
		return recommendation;
	}

	public void setRecommendation(String recommendation) {
		this.recommendation = recommendation;
	}

	public String getKeyWord() {
		return keyWord;
	}

	public void setKeyWord(String keyWord) {
		this.keyWord = keyWord;
	}

	public String getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(String categoryId) {
		this.categoryId = categoryId;
	}

	public String getBrandId() {
		return brandId;
	}

	public void setBrandId(String brandId) {
		this.brandId = brandId;
	}

	public String getVendorUuid() {
		return vendorUuid;
	}

	public void setVendorUuid(String vendorUuid) {
		this.vendorUuid = vendorUuid;
	}

	public String getWarehouseUuid() {
		return warehouseUuid;
	}

	public void setWarehouseUuid(String warehouseUuid) {
		this.warehouseUuid = warehouseUuid;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getSmallUnit() {
		return smallUnit;
	}

	public void setSmallUnit(String smallUnit) {
		this.smallUnit = smallUnit;
	}

	public String getBigUnit() {
		return bigUnit;
	}

	public void setBigUnit(String bigUnit) {
		this.bigUnit = bigUnit;
	}

	public int getChangeNum() {
		return changeNum;
	}

	public void setChangeNum(int changeNum) {
		this.changeNum = changeNum;
	}

	public String getSmallBarcode() {
		return smallBarcode;
	}

	public void setSmallBarcode(String smallBarcode) {
		this.smallBarcode = smallBarcode;
	}

	public String getBigBarcode() {
		return bigBarcode;
	}

	public void setBigBarcode(String bigBarcode) {
		this.bigBarcode = bigBarcode;
	}

	public double getSmallWeight() {
		return smallWeight;
	}

	public void setSmallWeight(double smallWeight) {
		this.smallWeight = smallWeight;
	}

	public boolean isPutonState() {
		return putonState;
	}

	public void setPutonState(boolean putonState) {
		this.putonState = putonState;
	}

	public boolean isSpecState() {
		return specState;
	}

	public void setSpecState(boolean specState) {
		this.specState = specState;
	}

	public String getProductTag() {
		return productTag;
	}

	public void setProductTag(String productTag) {
		this.productTag = productTag;
	}

	public String getAuditor() {
		return auditor;
	}

	public void setAuditor(String auditor) {
		this.auditor = auditor;
	}

	public String getAuditState() {
		return auditState;
	}

	public void setAuditState(String auditState) {
		this.auditState = auditState;
	}

	public String getAuditTime() {
		return auditTime;
	}

	public void setAuditTime(String auditTime) {
		this.auditTime = auditTime;
	}

	public String getAuditNote() {
		return auditNote;
	}

	public void setAuditNote(String auditNote) {
		this.auditNote = auditNote;
	}
	
	public String getProductTagName() {
		// 商品有多标签
		String tagName = "";
		if(this.productTag != "" && this.productTag != null){
			String[] tags = this.productTag.split(",");
			if(tags != null && tags.length > 0){
				for (String tag : tags) {
					tagName = tagName + "," + ProductConstant.productTagMap.get(tag);
				}
			}
			tagName = tagName.replaceFirst(",", "");
		}
		return tagName;
	}

	public void setProductTagName(String productTagName) {
		this.productTagName = productTagName;
	}
	
	public String getBrandName() {
		return brandName;
	}

	public void setBrandName(String brandName) {
		this.brandName = brandName;
	}

	public String getVendorName() {
		return vendorName;
	}

	public void setVendorName(String vendorName) {
		this.vendorName = vendorName;
	}

	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	public int getTradeNum() {
		return tradeNum;
	}

	public void setTradeNum(int tradeNum) {
		this.tradeNum = tradeNum;
	}

	public String getTradeNumUnit() {
		return tradeNumUnit;
	}

	public void setTradeNumUnit(String tradeNumUnit) {
		this.tradeNumUnit = tradeNumUnit;
	}

	public ProductDescDTO getProductDesc() {
		return productDesc;
	}

	public void setProductDesc(ProductDescDTO productDesc) {
		this.productDesc = productDesc;
	}

	
}
